package com.franklin.ideaplugin.maphelper.resolver.impl.map;

import com.franklin.ideaplugin.maphelper.resolver.AbstractColMemberResolverFactory;
import com.franklin.ideaplugin.maphelper.resolver.IColMemberResolver;
import com.franklin.ideaplugin.maphelper.resolver.impl.map.json.fastjson.FastJsonInnerJsonMethodChainMemberResolver;
import com.franklin.ideaplugin.maphelper.resolver.impl.map.json.fastjson.FastJsonParseObjectMethodCallExpressionColMemberResolver;
import com.google.common.collect.Lists;
import com.intellij.openapi.application.ApplicationManager;

import java.util.List;

/**
 * @author Ye Junhui
 * @since 2024/3/6
 */
public class MapMemberResolverFactory extends AbstractColMemberResolverFactory {

    @Override
    protected List<IColMemberResolver> getColMemberResolverList() {
        return Lists.newArrayList(
                MapNewExpressionMemberResolver.INSTANCE,
                FastJsonParseObjectMethodCallExpressionColMemberResolver.INSTANCE,
                FastJsonInnerJsonMethodChainMemberResolver.INSTANCE,
                InnerMapMapMethodCallExpressionMemberResolver.INSTANCE,
                SpecialMapMethodCallExpressionMemberResolver.INSTANCE,
                MapMethodCallExpressionMemberResolver.INSTANCE,
                CollectionMapMemberResolver.INSTANCE,
                CollectionGetMapMemberResolver.INSTANCE
        );
    }

    public static MapMemberResolverFactory getInstance() {
        return ApplicationManager.getApplication().getService(MapMemberResolverFactory.class);
    }

}
